package com.xinxin.socket.encoder;

import com.xinxin.socket.msg.NetMsg;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author ys
 * @date 2020/8/7
 */
public final class NetMsgEncoder extends MessageToByteEncoder<NetMsg> {

    @Override
    protected void encode(ChannelHandlerContext ctx, NetMsg msg, ByteBuf out) throws Exception {
        msg.encode(out);
    }
}
